<template>
	<!-- 排行榜 -->
	<view class="content">
		<u-action-sheet :list="list" v-model="sheet" @click="click"></u-action-sheet>
		<u-navbar back-text="" title="">
			<view class="slot-wrap" @click="doSheet()">
				{{param.text}}
			</view>
		</u-navbar>
		<view class="l-body">
			<book-list  :disable="{type:true, news:true, endTime: true}"
				:dataSource="dataSource" 
				:enablePage="true"
				:dataUrl="dataUrl"
				:nextPage="nextPage"
				:key="timer">
			</book-list>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sourceUrl:'https://m.xbiquwx.la/',
				param: {
					text: '日点击榜',
					type: 'dayvisit'
				},
				list: [{
					text: '日点击榜',
					type: 'dayvisit'
				}, {
					text: '周点击榜',
					type: 'weekvisit'
				}, {
					text: '月点击榜',
					type: 'monthvisit'
				}, {
					text: '总点击榜',
					type: 'allvisit'
				}, {
					text: '周推荐榜',
					type: 'weekvote'
				}, {
					text: '月推荐榜',
					type: 'monthvote'
				}, {
					text: '总推荐榜',
					type: 'allvote'
				}, {
					text: '总收藏榜',
					type: 'goodnum'
				}, {
					text: '字数排行',
					type: 'size'
				}, {
					text: '最新入库',
					type: 'postdate'
				}, {
					text: '最近更新',
					type: 'lastupdate'
				}, {
					text: '新书榜单',
					type: 'goodnew'
				}],
				sheet: false,
				dataSource: 'https://m.xbiquwx.la/',
				dataUrl: 'paihangbang_dayvisit',
				nextPage: 1,
				timer: ''
			}
		},
		methods: {
			click(index) {
				this.param = {
					text: this.list[index].text,
					type: this.list[index].type
				}
				this.dataUrl = 'paihangbang_' + this.param.type;
				this.timer = new Date().getTime()
			},
			doSheet() {
				this.sheet = true;
			}
		},
		onReachBottom() {
			this.nextPage = this.nextPage + 1;
		}
	}
</script>

<style>
	.slot-wrap {
			display: flex;
			align-items: center;
			/* 如果您想让slot内容占满整个导航栏的宽度 */
			flex: 1;
			/* 如果您想让slot内容与导航栏左右有空隙 */
			padding-right: 50rpx;
			justify-content: center;
			font-size: 32rpx;
		}
</style>